package com.wing.cabinet.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wing.cabinet.model.entity.CabinetCargoLane;
import com.wing.cabinet.model.response.CabinetCargoLaneVO;
import com.wing.cabinet.model.response.CabinetCargoSpaceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 刀柜货道-Dao
 *
 * @author
 */
@Mapper
public interface CabinetCargoLaneDao extends BaseMapper<CabinetCargoLane> {

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<CabinetCargoLaneVO> list4app(@Param("params") Map<String, Object> params);

    /**
     * 分页列表-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    List<CabinetCargoLaneVO> list4app(@Param("page") Page<CabinetCargoLaneVO> page, @Param("params") Map<String, Object> params);

    List<CabinetCargoLaneVO> list4Check(@Param("page") Page<CabinetCargoLaneVO> page, @Param("params") Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    CabinetCargoLaneVO get4appById(Long id);


    List<CabinetCargoLaneVO> getUsableSpace(@Param("cabCode")String cabCode,@Param("skuCode") String skuCode,@Param("quantity") Integer quantity);

    List<CabinetCargoLaneVO> getEmptySpaces(@Param("cabCode")String cabCode);

    List<CabinetCargoLaneVO> getSkuSpaces(@Param("cabCode")String cabCode);

    List<CabinetCargoLaneVO> getWcabSpaceByCabCode(@Param("cabCodes")String[] cabCodes,@Param("spaceTypes")List<Integer> spaceTypes);

    List<CabinetCargoLaneVO> getWcabOptimalSpaceByCabCode(@Param("cabCodes")String[] cabCodes,@Param("spaceTypes")List<Integer> spaceTypes,@Param("skuCode")String skuCode,@Param("orderDesc")String orderDesc);

    List<CabinetCargoLaneVO> getWcabEmptySpaces(@Param("cabCodes")String[] cabCodes);

    Integer countLanesByMainCabCode(@Param("mainCabCode") String mainCabCode);
}
